//
//  BottomToolBar.swift
//  JLDiaryApp
//
//  Created by Jiang Chencheng on 2024/9/24.
//

import SwiftUI

/// 底部 工具栏
struct BottomToolBar: View {
    var body: some View {
        HStack(spacing: 20) {
            BottomToolBarItem(systemName: "hammer.fill")
            BottomToolBarItem(systemName: "gift.fill")
            BottomToolBarItem(systemName: "heart.fill")
            
            NavigationLink {
                SignupView()
            } label: {
                BottomToolBarItem(systemName: "person.fill")
            }
            
            BottomToolBarItem(systemName: "bell.fill")
        }
    }
}


/// 底部 工具栏按钮
struct BottomToolBarItem: View {
    
    var systemName: String
    var backgroundColor: Color = .white.opacity(0.1)
    var foregroundColor: Color = .white
    
    var body: some View {
        Image(systemName: systemName)
            .frame(width: 50, height: 50)
            .background(backgroundColor)
            .foregroundColor(foregroundColor)
            .cornerRadius(10)
    }
}

#Preview {
    BottomToolBar()
}
